#!/bin/sh
paramnum=$#
if((paramnum==0)); then
echo no params;
exit;
fi

echo "import job is starting..."

dateStr=$1
newDate=`date -d $dateStr "+%Y%m%d"`

source /etc/profile
hive -e "LOAD DATA INPATH '/user_clicks/$newDate/clicklog.dat' INTO TABLE mydb.user_clicks partition(dt='$dateStr');"
echo "import job is finished..."
exit
